package com.hogae.capital.service.impl;

import java.util.List;
import com.hogae.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hogae.capital.mapper.CapWithdrawalRecordMapper;
import com.hogae.capital.domain.CapWithdrawalRecord;
import com.hogae.capital.service.ICapWithdrawalRecordService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 提现记录Service业务层处理
 * 
 * @author hogae
 * @date 2021-02-26
 */
@Service
@Transactional(rollbackFor=Exception.class)
public class CapWithdrawalRecordServiceImpl implements ICapWithdrawalRecordService 
{
    @Autowired
    private CapWithdrawalRecordMapper capWithdrawalRecordMapper;

    /**
     * 查询提现记录
     * 
     * @param id 提现记录ID
     * @return 提现记录
     */
    @Override
    public CapWithdrawalRecord selectCapWithdrawalRecordById(Long id)
    {
        return capWithdrawalRecordMapper.selectCapWithdrawalRecordById(id);
    }

    /**
     * 查询提现记录列表
     * 
     * @param capWithdrawalRecord 提现记录
     * @return 提现记录
     */
    @Override
    public List<CapWithdrawalRecord> selectCapWithdrawalRecordList(CapWithdrawalRecord capWithdrawalRecord)
    {
        return capWithdrawalRecordMapper.selectCapWithdrawalRecordList(capWithdrawalRecord);
    }

    /**
     * 新增提现记录
     * 
     * @param capWithdrawalRecord 提现记录
     * @return 结果
     */
    @Override
    public int insertCapWithdrawalRecord(CapWithdrawalRecord capWithdrawalRecord)
    {
        capWithdrawalRecord.setCreateTime(DateUtils.getNowDate());
        return capWithdrawalRecordMapper.insertCapWithdrawalRecord(capWithdrawalRecord);
    }

    /**
     * 修改提现记录
     * 
     * @param capWithdrawalRecord 提现记录
     * @return 结果
     */
    @Override
    public int updateCapWithdrawalRecord(CapWithdrawalRecord capWithdrawalRecord)
    {
        capWithdrawalRecord.setUpdateTime(DateUtils.getNowDate());
        return capWithdrawalRecordMapper.updateCapWithdrawalRecord(capWithdrawalRecord);
    }

    /**
     * 批量删除提现记录
     * 
     * @param ids 需要删除的提现记录ID
     * @return 结果
     */
    @Override
    public int deleteCapWithdrawalRecordByIds(Long[] ids)
    {
        return capWithdrawalRecordMapper.deleteCapWithdrawalRecordByIds(ids);
    }

    /**
     * 删除提现记录信息
     * 
     * @param id 提现记录ID
     * @return 结果
     */
    @Override
    public int deleteCapWithdrawalRecordById(Long id)
    {
        return capWithdrawalRecordMapper.deleteCapWithdrawalRecordById(id);
    }
}
